package com.cskaoyan.service.impl;

import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.MarketAftersale;
import com.cskaoyan.mapper.MarketAftersaleMapper;
import com.cskaoyan.service.MarketAftersaleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * (MarketAftersale)表服务实现类
 *
 * @author makejava
 * @since 2021-10-18 22:15:43
 */
@Service("marketAftersaleService")
public class MarketAftersaleServiceImpl implements MarketAftersaleService {
    @Resource
    private MarketAftersaleMapper marketAftersaleMapper;


    /**
     * 分页查询
     *

     * @return 查询结果
     */
    @Override
    public List<MarketAftersale> queryByPage(String aftersaleSn,
                                             Integer orderId, BaseParam param, Integer status) {
        List<MarketAftersale> marketAftersales = marketAftersaleMapper.queryAllByLimit(aftersaleSn, param.getOrder(), orderId, param.getSort(), status);
        return marketAftersales;
    }


    /**
     * 同意
     *
     *
     * @return 整型
     */
    @Override
    public int recept(Integer id) {
       return marketAftersaleMapper.recept(id);
    }

    /**
     * 拒绝
     *
     *
     * @return 整型
     */
    @Override
    public int reject(Integer id) {

       return marketAftersaleMapper.reject(id);
    }

    /**
     * 退款
     *
     *
     * @return 整型
     */
    @Override
    public int refund(Integer id) {
        Integer refund = marketAftersaleMapper.refund(id);
        return refund;
    }
    }
